#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <ctype.h>
#include <string.h>

int atof(char x[])
{ 
	int i, sign, val;
	for(i = 0; isspace(x[i]); i++)
	;
	sign = (x[i] == '-') ? -1 : 1;
	if (x[i] == '+' || x[i] == '-')
	{
		sign = (x[i] == '-') ? -1 : 1;
		i++;
	}
	for(val = 0; isdigit(x[i]); i++)
	{
		val = 10 * val + (x[i] - '0');
	}  
    return (val * sign );   
}

int main()
{
	char a[100] = { 0 };
	int i, result;
    printf("char->%d\n", sizeof(char));
    printf("int->%d\n", sizeof(int));
    printf("short->%d\n", sizeof(short));
    printf("float->%d\n", sizeof(float));
	for (i = 0; i < 100; i++)
	{
		scanf("%c", &a[i]);
		if (a[i] == '\n')
		{
			a[i] = '\0';
				break;
		}
	}
    result = atof(a);
	printf("%d\n", result);     
	return 0;
}

////void revers(char c[])
////{
////	int size,left,right;
////	size = strlen(c);
////	left = 0;
////	right = size;
////	for (; left <= right; left++, right--)
////	{
////		char mid = 0;
////		mid = c[left];
////		c[left] = c[right];
////		c[right] = mid;
////	}
////}
////
////void atoi(int a, char b[])
////{
////	int i;
////	for (i = 0; i < 10; i++)
////	{
////		b[i] = a % 10 + '0';
////		a /= 10;
////		if (a == 0)
////		{
////			b[i + 1] = '\0';
////			break;
////		}
////	}
////
////	revers(b);
////}
////
////int main()
////{
////	int x, y, i;
////	char arr[10];
////	scanf("%d",&x);
////	atoi(x,arr);
////	for (i = 0; i < 10; i++)
////	{
////		printf("%c", arr[i]);
////	}
////	printf("\n");
////	return 0;
////}